package com.itheima.myreflect3;

/**
 * @program: Myset
 * @description:
 * @author: xuejingjing
 * @create: 2021-06-27 21:02
 **/
public class Student {

    private String name;
    private int age;

    //私有的有参构造方法
    private Student(String name){
        System.out.println("private...name的值为:"+ name);
        System.out.println("private...student...有参构造方法");
    }

    //公共的无参构造方法
    public Student(){
        System.out.println("public...Student...无参构造方法");
    }

    //公共的有参构造方法
    public Student(String name,int age){
        System.out.println("name的值为:" + name + "age的值为:" + age);
        System.out.println("public...student...有参构造方法");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
